<!DOCTYPE HTML>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="header.html :: commonHead"></head>

<body>
<header th:replace="header.html :: pageHeader"></header>
<main role="main">
    <div class="container bg-light py-3 px-lg-5 py-lg-5">


        <h1 style="padding-bottom: 20px">服务鉴权演示</h1>

        <p></p>
        <p>此页面为演示服务鉴权功能使用，调用结果显示最近对可指定黑（白）名单的，路径（接口）的 10 次调用中，可得到状态码分别返回了多少次</p>
        <p>点击"开启流量调用"后，frontend 应用将不停地调用 以下路径/接口</p>
        <p>持续一分钟，一分钟后调用停止，数据清空，如想再看数据，请再次点击“开启流量调用”</p>
        <p>点击"停止流量调用"后，流量调用被停止，同时清空数据</p>

        <h3 style="padding-top: 20px; padding-bottom: 10px">流量开关</h3>
        <div class="row">
            <div class="col-md-6">
                <a th:href="@{/auth/begin}">
                    <button type="button" class="btn">开启流量调用</button>
                </a>
                <div th:if="${message}" th:text="${message}" th:class="${'alert' + alertClass}"
                     style="padding-left: 5px; padding-top:10px"></div>
            </div>
            <div class="col-md-6">
                <a th:href="@{/auth/stop}">
                    <button type="button" class="btn">停止流量调用</button>
                </a>
                <div th:if="${message2}" th:text="${message2}" th:class="${'alert' + alertClass2}"
                     style="padding-left: 5px; padding-top:10px"></div>
            </div>

        </div>
        <p></p>
        <p></p>
        <p></p>

        <div class="row" style="padding-top: 20px">
            <div class="col-md-6">

                <h3 style="padding-bottom: 10px">Spring Cloud 调用结果</h3>

                <p>格式：标题为Path</p>
                <p>点击“开始调用”，刷新后返回状态码，200为正常</p>
                <p>若最近10次调用返回同一状态码，在状态码下方将不显示调用次数</p>
                <div class="col-md-6">
                    <div>
                        <p>/product/OLJCESPC7Z</p>
                        <div class="card mb-6 box-shadow">
                            <div th:each="resultNode0: ${product0}" class="card-body">
                                <h5 class="card-title" th:text="${resultNode0.result}"></h5>

                                <h5 th:if="${resultNode0.display}" th:text="${resultNode0.times}"></h5>
                            </div>

                        </div>
                        <p></p>
                        <p>/product/66VCHSJNUP</p>
                        <div class="card mb-6 box-shadow">
                            <div th:each="resultNode1: ${product1}" class="card-body">
                                <h5 class="card-title" th:text="${resultNode1.result}"></h5>
                                <h5 th:if="${resultNode1.display}" th:text="${resultNode1.times}"></h5>
                            </div>
                        </div>
                        <p></p>
                        <p>/product/1YMWWN1N4O</p>
                        <div class="card mb-6 box-shadow">
                            <div th:each="resultNode2: ${product2}" class="card-body">
                                <h5 class="card-title" th:text="${resultNode2.result}"></h5>
                                <h5 th:if="${resultNode2.display}" th:text="${resultNode2.times}"></h5>
                            </div>
                        </div>
                        <p></p>
                        <p>/product/L9ECAV7KIM</p>
                        <div class="card mb-6 box-shadow">
                            <div th:each="resultNode3: ${product3}" class="card-body">
                                <h5 class="card-title" th:text="${resultNode3.result}"></h5>
                                <h5 th:if="${resultNode3.display}" th:text="${resultNode3.times}"></h5>
                            </div>
                        </div>
                        <p></p>
                        <p>/product/2ZYFJ3GM2N</p>
                        <div class="card mb-6 box-shadow">
                            <div th:each="resultNode4: ${product4}" class="card-body">
                                <h5 class="card-title" th:text="${resultNode4.result}"></h5>
                                <h5 th:if="${resultNode4.display}" th:text="${resultNode4.times}"></h5>
                            </div>
                        </div>
                        <p></p>
                        <p>/product/0PUK6V6EV0</p>
                        <div class="card mb-6 box-shadow">
                            <div th:each="resultNode5: ${product5}" class="card-body">
                                <h5 class="card-title" th:text="${resultNode5.result}"></h5>
                                <h5 th:if="${resultNode5.display}" th:text="${resultNode5.times}"></h5>
                            </div>
                        </div>
                        <p></p>
                    </div>

                </div>


                <p></p>
                <p></p>
                <p></p>

            </div>


            <div class="col-md-6">

                <h3 style="padding-bottom: 10px">Dubbo 调用结果</h3>

                <p>格式：标题为接口</p>
                <p>点击“开始调用”，刷新后返回状态码，200为正常</p>
                <p>若最近10次调用返回同一状态码，在状态码下方将不显示调用次数</p>
                <p>com.alibabacloud.hipstershop.CartService: viewCart()</p>
                <div th:each="resultNode: ${dubbo_auth_result}" class="col-md-6">
                    <div class="card mb-6 box-shadow">

                        <div class="card-body">
                            <h5 class="card-title" th:text="${resultNode.result}"></h5>
                            <h5 th:if="${resultNode.display}" th:text="${resultNode.times}"></h5>
                        </div>
                    </div>
                    <p></p>
                </div>

                <p></p>
                <p></p>
                <p></p>

            </div>
        </div>
    </div>


</main>

<footer th:replace="footer.html :: pageFooter"></footer>
<script th:replace="footer.html :: footerScript"></script>
</body>
</html>